<?php

    /**
     * @package      Modules
     * @subpackage   Base_Controllers_Front
     *
     * @license      GNU Lesser General Public Licence see LICENCE-LGPL file or http://www.gnu.org/licenses/lgpl.html
     */
     class Base_Controllers_Front_Root extends Core_Controller_Action_Abstract
     {

    ////////////////////////////////////////////////////////////////////////////
    //                                Variables                               //
    ////////////////////////////////////////////////////////////////////////////

       /**
        * Parameters for plugin
        *
        * @var array
        */
        protected $_pluginParams = array('*' => array('auth.required' => false, 'redirect.required' => true));

        /**
         * Current category slug
         *
         * @var     string
         */
        protected $_currentPageCategory = null;

        /**
         * Current page slug
         *
         * @var     string
         */
        protected $_currentPage = null;

    ////////////////////////////////////////////////////////////////////////////
    //                                Public methods                          //
    ////////////////////////////////////////////////////////////////////////////

        /**
         * Output response to template
         *
         * @return  Core_Controller_Response_Abstract
         */
        public function initResponse()
        {
            $rep = $this->_getResponse('http');

            if ($this->_getParam('pageObject')) {
                $rep->setTemplate($this->_getParam('pageObject')->template);
                $rep->data->assign('meta_verify', $this->_getParam('pageObject')->meta_verify);
                $rep->data->assign('page', $this->_getParam('pageObject'));
            }

            $this->preProcess();

            return $rep;
        }

        /**
         * Output an async response to template
         *
         * @return  Core_Controller_Response_Xml
         */
        public function initAsyncResponse()
        {
            $rep = $this->_getResponse('xml');

            if ($this->_getParam('pageObject')) {
                $rep->setTemplate($this->_getParam('pageObject')->template);
            }

            return $rep;
        }

        /**
         * Treatments can be done before process
         *
         * @return      void
         */
        public function preProcess()
        {
            return;
        }
    }
